package com.office.web.controller.file.domain;

/**
 * @author: 柒月
 * @date: 2025/5/28 下午2:25
 * @version: 1.0
 */
import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

/**
 * 文件上传信息实体类（与数据库 sys_file 表对应）
 */
public class FileUploadDomain {
    /**
     * 文件ID，主键自增
     */
    private Long id;

    /**
     * 原始文件名（用户上传时的名字）
     */
    private String originalName;

    /**
     * 存储文件名
     */
    private String fileName;

    /**
     * 文件访问链接（可为本地路径或 MinIO 等外链地址）
     */
    private String url;

    /**
     * 文件大小，单位：字节
     */
    private Long fileSize;

    /**
     * MIME类型，例如 image/jpeg, application/pdf
     */
    private String contentType;

    /**
     * 上传时间，默认当前时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date uploadTime;

    /**
     * 删除标志，0:未删除，1:已删除（软删除）
     */
    private Integer delFlag;

    /**
     * 创建人（用户ID）
     */
    private Long createBy;

    /**
     * 备注信息（可选）
     */
    private String remark;

    public FileUploadDomain() {
    }

    public FileUploadDomain(String contentType, String fileName, Long fileSize, String originalName, String url) {
        this.contentType = contentType;
        this.fileName = fileName;
        this.fileSize = fileSize;
        this.originalName = originalName;
        this.url = url;
    }

    // Getter 和 Setter 方法

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getOriginalName() {
        return originalName;
    }

    public void setOriginalName(String originalName) {
        this.originalName = originalName;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Long getFileSize() {
        return fileSize;
    }

    public void setFileSize(Long fileSize) {
        this.fileSize = fileSize;
    }

    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public Date getUploadTime() {
        return uploadTime;
    }

    public void setUploadTime(Date uploadTime) {
        this.uploadTime = uploadTime;
    }

    public Integer getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(Integer delFlag) {
        this.delFlag = delFlag;
    }

    public Long getCreateBy() {
        return createBy;
    }

    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}